<?php
// Customer Model parent class
class AppModel extends Model {
    public function beforeFind(){
        $this->query('set names utf8');
    }
    public function beforeSave(){
        $this->query('set names utf8');
        return true;
    }
    /* Method to track data record viewed times, shared by Post, Company, Job */
    public function updateClicks($id=null){
        if(!$id){ return false; }
        $this->id = $id;
        $this->saveField('clicks', $this->field('clicks', 'id = '.$id)+1);
    }
}
?>